package com.kgo.usermanage.shiro.filter;

import org.apache.shiro.web.filter.authc.FormAuthenticationFilter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * @author keepgoon
 * @Description: TODO
 * @date 2018/12/1512:32
 */
public class LoginFilter extends FormAuthenticationFilter {
    Logger log = LoggerFactory.getLogger(LoginFilter.class);
    private HttpServletRequest _request;
    private HttpServletResponse _response;
    @Override
    protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception {
      _request = (HttpServletRequest) request;
      _response = (HttpServletResponse) response;
      HttpSession session = _request.getSession();
      log.info("进入过滤器:" + _request.getRequestURL());
      return super.onAccessDenied(request, response);
    }
}
